#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> totalSales(N, 0);
    for (int i = 0; i < M; ++i) {
        for (int j = 0; j < N; ++j) {
            int sales;
            cin >> sales;
            totalSales[j] += sales;
        }
    }
    
    int maxSales = *max_element(totalSales.begin(), totalSales.end());
    
    vector<int> champions;
    for (int i = 0; i < N; ++i) {
        if (totalSales[i] == maxSales) {
            champions.push_back(i + 1);
        }
    }
    
    cout << maxSales << endl;
    for (int i = 0; i < champions.size(); ++i) {
        if (i > 0) {
            cout << " ";
        }
        cout << champions[i];
    }
    cout << endl;
    return 0;
}    